
file_path = 'D:/工作/3、需求/9、数据分析驾驶舱数据支撑/19、新需求/历史数据脚本组装/2024-07-10至2024-07-25生产数据/1、生产数据/53-增值收益存款-增值收益定期存款.txt'
file = open(file_path, 'r', encoding='UTF-8')
for f in file:
    f = f.strip()
    f_list = f.split(',')
    print(f_list)
    datetime = f_list[0]
    business_code = f_list[2]
    business_desc = f_list[3]
    catetory_code = f_list[4]
    catetory_desc = f_list[5]
    category_value = float(f_list[6])
    print(f'{datetime}, {business_code}, {business_desc}, {catetory_code}, {catetory_desc}, {category_value}')
    insert_sql = f"INSERT INTO LC0003 (DATETIME,CODE,BUSSINESSNAME,DOTNAME,CATEGORYCODE,CATEGORYNAME,CATEGORYCOUNT,PROPORTION,CREATEDDATE,CREATOR,UPDATEDATE,UPDATOR,YEARNUM,CATEGORYVALUE) " \
                 f"VALUES ('{datetime}', '{business_code}, '{business_desc}', '-', '{catetory_code}', '{catetory_desc}', 0, '-', sysdate, 'Y02906', sysdate, 'Y02906', 2024, {category_value});"
    print(insert_sql)
    break
